package jp.co.technotree.common.ctrl;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.HashMap;

public class FormBeanInfo {
	public static enum EnumMethodType {
		TYPE_UNDEFINE
		,TYPE_STRING
		,TYPE_INT
		,TYPE_LONG
		,TYPE_FLOAT
		,TYPE_DOUBLE
		,TYPE_BIGDECIMAL
		,TYPE_BOOLEAN
		,TYPE_TIME
		,TYPE_DATE
		,TYPE_OBJECT
		,TYPE_UPLOADFILEBEAN
	}
	
	public static class MethodInfo {
		public String methodName = null;
		public EnumMethodType methodType = null;
		public Method method = null;
		public FormBeanInfo formBeanInfo = null;
		public FormBeanInfo parentInfo = null;
		public boolean isArray = false;
	}
	
	
	public FormBeanInfo parentInfo = null;
	public MethodInfo parentMethodInfo = null;
	
	public String actionName = null;
	public String beanName = null;
	public Class<?> beanClass = null;
	
	
	
	private HashMap<String,MethodInfo> methodMap = new HashMap<String,MethodInfo>();
	private ArrayList<MethodInfo> methodArray = new ArrayList<MethodInfo>();
	
	public void setMethod(String methodName,MethodInfo methodInfo){
		methodMap.put(methodName,methodInfo);
		methodArray.add(methodInfo);
	}
	public int getNumMethod(){
		return methodArray.size();
	}
	public MethodInfo getMethodInfo(String methodName){
		return methodMap.get(methodName);
	}
	public MethodInfo getMethodInfo(int index){
		return methodArray.get(index);
	}
	
	public String toString(){
		return beanClass.getSimpleName();
	}
}


